﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using SqlHelper;

namespace DAL
{
    public class StepDataDatabase
    {
        /// <summary>
        /// 根据条件显示阶梯收费用户类型
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static DataSet GetStepData(string gasuserid,out int jtZG,out int isStep)
        {
            jtZG = 0;
            isStep = 0;
            DataSet ds = null;
            SqlConnection conn = null;
            SqlParameter[] paramList = { DbHelper.CreateCommandParameter("@Gasuserid",SqlDbType.VarChar,gasuserid),
                                         DbHelper.CreateCommandOutputParameter("@IsStep",SqlDbType.Int,4),
                                         DbHelper.CreateCommandOutputParameter("@JtZG",SqlDbType.Int,4)
                                  };
            try
            {
                conn = DbHelper.CreateDbConnection(DbHelper.DbConnectionString);
                conn.Open();
                ds = DbHelper.GetDataSetByProcedure("NXS_GetStepData", paramList, conn);
                isStep = Convert.ToInt32(paramList[1].Value);
                jtZG = Convert.ToInt32(paramList[2].Value);
            }
            catch (SqlException ex)
            {
                ds = null;
            }
            finally
            {
                conn.Close();
            }

            return ds;
        }

    }
}
